package com.yunxi.controller.otd;

import com.yunxi.core.web.ApiResult;
import com.yunxi.otd.pojo.OtdOrderMonthEditVO;
import com.yunxi.otd.pojo.OtdOrderMonthImportVO;
import com.yunxi.otd.pojo.OtdOrderMonthQueryVO;
import com.yunxi.otd.pojo.OtdOrderMonthReleaseVO;
import com.yunxi.otd.service.OtdOrderMonthDubboService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 月排产需求订单 前端控制器
 * </p>
 *
 * @author XUQI
 * @since 2019-07-15
 */
@RestController
@RequestMapping("/admin/otd/order/month")
@Api(tags = "OTD:ORDERMONTH", description = "月排产需求订单接口")
public class OtdOrderMonthController {

    @Autowired
    OtdOrderMonthDubboService otdOrderMonthDubboService;

    @GetMapping("/page")
    @ApiOperation(value = "分页查询")
    public ApiResult page(OtdOrderMonthQueryVO queryVO) {
        return otdOrderMonthDubboService.page(queryVO);
    }

    @PostMapping("/import")
    @ApiOperation(value = "月需求导入")
    public ApiResult importData(@RequestBody OtdOrderMonthImportVO importVO) {
        return otdOrderMonthDubboService.importData(importVO);
    }

    @PostMapping("/edit")
    @ApiOperation(value = "月需求编辑")
    public ApiResult editNum(@RequestBody OtdOrderMonthEditVO editVO) {
        return otdOrderMonthDubboService.editNum(editVO);
    }

    @PostMapping("/release")
    @ApiOperation(value = "释放月计划")
    public ApiResult release(@RequestBody OtdOrderMonthReleaseVO releaseVO) {
        return otdOrderMonthDubboService.release(releaseVO);
    }
}
